<template>
    <div class="money">
        <van-nav-bar
        border
        title="用户余额"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
        />
        <div style="text-align:lefe;padding-left:40px
        ;line-height:100px">实际收益金额:{{newList}}
        <van-button size="small" type="default" color="#E87C8C" round block @click="CashOut">提现</van-button></div>
        <div class="m_img">
            <div class="income_content">
                <div style="padding-top:15px" v-for="c in money" :key="c.id">
                    <van-cell icon="balance-o" title="收益" :value="c.money" />
                    <van-cell icon="clock-o" title="服务时间" :value="c.transactionTime | dateParse">
                    </van-cell>
                    <van-cell icon="chat-o" title="收益描述" :value="c.description" />
                    <van-cell icon="user-o" title="服务对象" :value="c.userId" />
                </div>
            </div>
        </div>
    </div>
</template>
<script>
// import userVue from './user.vue'
import { mapState,mapGetters, mapActions } from 'vuex'

export default {
   
    data(){
        return{
            id:'',
            array:[],
            Map:[]
        }
    },
    
    created(){
        this.id = localStorage.getItem('id')
        this.loadMoney();
        
    },
    mounted(){
        this.global.setid(this.newList);
        // console.log(this.newList)
    },
    computed:{
        ...mapState('money',['money']),
        ...mapGetters('money',['newList','all'])
    },
    methods:{
        ...mapActions('money',['toLoadMoney']),
        onClickLeft(){
            this.$router.push({path:'user'})
        },
        loadMoney(){
            this.toLoadMoney(this.id)
           
        },
        CashOut(){
            this.$router.push({path:'CashOut',query:{id:this.id}})
        }
    }
}
</script>
<style scoped>
.m_img{
    width: 100%;
    height: 90vh;
}
.money .van-icon{
    float: left;
    margin-top: 30px;
    margin-left: 40px;
}
.showMoney{
    width: 80%;
    height: 40px;
    margin: 0 auto;
    line-height: 40px;
}
.showMoney span{
    font-size: 20px;
    text-align: left;
    display: inline-block;
    width: 120px;
    height: inherit;
}
.van-button{
    float: right;
    width: 100px;
    margin-top: 37px;
    margin-right:15px;
}
.income_content{
    margin-top:-30px;
}
.income_content div{
    padding-left: 20px;
    text-align: left;
}
.income_content .van-cell{
    width: 100%;
    height: 20px;
    padding: 0;
}
.money .van-cell::after{
    border: none;
}
.money .van-cell__value{
    padding-left: 0;
}
.money >>> .van-cell__title{
    flex: 0.3;    
}
.money .van-icon[data-v-4b13a934]{
    margin: 0;
}
</style>